#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

class QLabel;

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE


class MainWindow : public QMainWindow
{
    Q_OBJECT

    // 必须与显示的列顺序保持一致
    enum FieldColNum { colName = 0, colSex, colBirth, colNation, colScore, colPartyM };
    // 与显示的列顺序无关
    enum CellType { ctName = 1000, ctSex, ctBirth, ctNation, ctPartyM, ctScore};

    QLabel *labCellIndex;
    QLabel *labCellType;
    QLabel *labStuId;

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_btnSetHeader_clicked();

    void on_btnSetRows_clicked();

    void on_btnInitTable_clicked();

    void on_btnInsertRow_clicked();

    void on_btnAppendRow_clicked();

    void on_btnDeleteCurRow_clicked();

    void on_btnFitRowHeight_clicked();

    void on_btnFitColumnWidte_clicked();

    void on_btnReadTableToText_clicked();

    void on_chkBoxTableEditable_clicked(bool checked);

    void on_chkBoxRowColor_clicked(bool checked);

    void on_chkBoxHeaderH_clicked(bool checked);

    void on_chkBoxHeaderV_clicked(bool checked);

    void on_rBtnSelectRow_clicked();

    void on_rBtnSelectItem_clicked();

    void on_tableWidget_currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn);

private:
    Ui::MainWindow *ui;

private:
    void createItemsArow(int rowNo, QString name, QString sex,
                         QDate birth, QString race, bool isParty,
                         int score);
};
#endif // MAINWINDOW_H
